
<div class="layui-form-item" id="<?php echo $field['name']; ?>">
    <div class="layui-form-label"><?php echo $field['title']; ?></div>
    <div class="layui-input-inline" style="width:200px;">
        <select name="province" class="province-selector" data-value="<?php echo isset($field['options']['province']) ? $field['options']['province'] : ''; ?>" lay-filter="province-1">
            <option value="">请选择省</option>
        </select>
    </div>
    <div class="layui-input-inline" style="width:200px;">
        <select name="city" class="city-selector" data-value="<?php echo isset($field['options']['city']) ? $field['options']['city'] : ''; ?>" lay-filter="city-1">
            <option value="">请选择市</option>
        </select>
    </div>
    <div class="layui-input-inline" style="width:200px;">
        <select name="county" class="county-selector" data-value="<?php echo isset($field['options']['county']) ? $field['options']['county'] : ''; ?>" lay-filter="county-1">
            <option value="">请选择区</option>
        </select>
    </div>
</div>


<script> 
    //一般直接写在一个js文件中
    layui.use(['layer', 'form', 'layarea'], function () {
        var layarea = layui.layarea;

        layarea.render({
            elem: '#<?php echo $field['name']; ?>',
            change: function (res) {
                //选择结果
                console.log(res);
            }
        });
    });
</script>

